<template>
  <ul class="contact-container">
    
    <li class="contact-item">
      <a target="_blank" :href="data.github">
        <Icon type="github" />
        <p>{{data.githubName}}</p>
      </a>
    </li>

    <li class="contact-item">
      <a :href="`mailto:${data.mail}`">
        <Icon type="mail" />
        <p>{{ data.mail }}</p>
      </a>
    </li>

    <li class="contact-item">
      <a :href="`tencent://message/?Menu=yes&uin=${data.qq}&Service=300&sigT=45a1e5847943b64c6ff3990f8a9e644d2b31356cb0b4ac6b24663a3c8dd0f8aa12a595b1714f9d45`">
        <Icon type="qq" />
        <p>{{ data.qq }}</p>
      </a>
      <div class="pop">
        <img :src="data.qqQrcode" alt="">
      </div>
    </li>

    <li class="contact-item">
      <a href="">
        <Icon type="weixin" class="weixin"/>
        <p>{{ data.weixin }}</p>
      </a>
      <div class="pop">
        <img :src="data.weixinQrCode" alt="">
      </div>
    </li>

  </ul>
</template>

<script>
import { mapState } from "vuex"
import Icon from '@/components/Icon'
export default {
  components: {
    Icon
  },
  computed: {
    ...mapState("setting", ["data"])
  }
}
</script>

<style lang="scss" scoped>
@import '~@/styles/global.scss';
.contact-container {
  list-style: none;
  background-color: transparent;
  width: 100%;
  color: $gray;
  padding-left: 0;
  li.contact-item {
    position: relative;
    a {
      font-size: 16px;
      display: flex;
      align-items: center;
      height: 50px;
      .icon-container {
        font-size: 26px;
        margin-right: 4px;
        &.weixin {
          font-size: 32px;
          text-indent: -3px;
        }
      }
      p {
        margin: 0 0;
      }
    }
    
    &:hover {
      .pop {
        transform: scaleY(1);
      }
    }
    .pop {
      position: absolute;
      left: 0;
      bottom: 50px;
      padding: 10px 15px;
      background-color: #fff;
      border-radius: 6px;
      transform: scaleY(0);
      transform-origin: center bottom;
      transition: .3s;
      img {
        width: 150px;
        height: 150px;
        display: block;
      }
      &::after {
        content: '';
        position: absolute;
        left: 50%;
        transform: translateX(-50%) rotate(45deg);
        width: 8px;
        height: 8px;
        background: #fff;
        bottom: -4px;
      }
    }
  }
}
</style>